package com.liuceng.zen.service;

import com.liuceng.zen.mapper.AdDirectedMapper;
import com.liuceng.zen.pojo.domain.AdDirected;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import java.util.Date;

/**
 * Created by lijunhao on 16-11-2.
 */
@Service
public class AdDirectedService extends BaseService<AdDirected>{
    @Autowired
    private AdDirectedMapper adDirectedMapper;

    public AdDirected save(AdDirected adDirected){
        Assert.notNull(adDirected);

        adDirected.setCreatedAt(new Date());
        adDirected.setUpdatedAt(new Date());
        adDirectedMapper.insertSelective(adDirected);
        return adDirected;
    }
}
